package nc.task.hdysc;

import java.util.List;
import java.util.Map;

import nc.bs.dao.BaseDAO;
import nc.bs.dao.DAOException;
import nc.hdysc.engine.impl.BaseSyncDataImpl;
import nc.hdysc.engine.itf.ISyncTask;
import nc.hdysc.pub.BaseUtil;
import nc.jdbc.framework.processor.MapListProcessor;
import nc.vo.hdysc.engine.SyncTaskVO;
import nc.vo.hdysc.groupassort.GroupAssortVO;
import nc.vo.hdysc.meetingroom.MeetingRoomVO;

public class MeetingRoomTask extends BaseSyncDataImpl<MeetingRoomVO> implements ISyncTask<MeetingRoomVO> {

	// private SyncTaskVO syncTaskVO;
	public MeetingRoomTask() throws DAOException, InstantiationException, IllegalAccessException,
			ClassNotFoundException {
		super(MeetingRoomVO.class);
	}

	public List<MeetingRoomVO> getDstDate() throws DAOException {
		List<MeetingRoomVO> meetingRoomList = (List<MeetingRoomVO>) dDao.retrieveAll(MeetingRoomVO.class);
		return meetingRoomList;
	}

	public List<Map<String, Object>> getSourceDate() throws DAOException {
		String sql = "select * from tbdMeetingRoomInfo  ";
		List<Map<String, Object>> meetingRoomList = (List<Map<String, Object>>) sDao.executeQuery(sql,
				new MapListProcessor());
		return meetingRoomList;
	}

	public SyncTaskVO getSyncTask() throws DAOException {
		SyncTaskVO syncTask = null;
		BaseDAO dao = new BaseDAO();
		syncTask = (SyncTaskVO) dao.retrieveByPK(SyncTaskVO.class, "0001AA1000000000G7C5");
		return syncTask;
	}

	public MeetingRoomVO beforeUpdateOrInsert(MeetingRoomVO t) {
		return t;
	}

	public int compare(MeetingRoomVO sVO, MeetingRoomVO dVO) {
		int compare = -1;
		String dCompare = dVO.getMeeting_code();
		String sCompare = sVO.getMeeting_code();
		if(!BaseUtil.emptyOrNull(dCompare) && !BaseUtil.emptyOrNull(sCompare) && dCompare.equals(sCompare)){
			compare =  1;
		}
		return compare;
		
		
	}

}
